class ApplicationController < ActionController::Base
  protect_from_forgery
  
  before_filter :authenticate_user!
  
  layout :layout_by_resource
  
  private 
  
  def layout_by_resource
    if devise_controller? 
      if resource_name == :user &&  action_name == 'new'     
        "sign_in"
      else
        "registration"
      end                      
    else
      "application"
    end
  end
end
